interface requestType {
  loading: boolean,
  requestingNum: number
}
export default {
  state: ():requestType => {
    return {
      loading: false, // 请求中
      requestingNum: 0, // 正在进行的请求
    }
  },
  mutations: {
    setLoading(state:requestType, loading:boolean) {
      state.loading = loading
    },
    addRequestingNum(state:requestType) {
      state.requestingNum++
    },
    subRequestingNum(state:requestType) {
      state.requestingNum--
    }
  },
}
